import java.util.Scanner;

/**
 * 计算器
 */
public class CalculatorDemo {
    public static void main(String[] arg) {
        int num01, num02;
        char opTor;
        Scanner sc = new Scanner(System.in);
        System.out.print("输入第一个数:");
        num01 = sc.nextInt();
        System.out.print("输入第二个数:");
        num02 = sc.nextInt();
        System.out.print("输入符号:");
        opTor = sc.next().charAt(0);
        switch (opTor) {
            case '+':
                System.out.println(num01 + num02);
                break;
            case '-':
                System.out.println(num01 - num02);
                break;
            case '*':
                System.out.println(num01 * num02);
                break;
            case '/':
                if (0 == num02) {
                    System.out.println("除数不能为0");
                } else {
                    System.out.println(num01 / num02);
                }
                break;
            default:
                System.out.println("输入错误!");
        }
    }
}
